home *** CD-ROM | disk | FTP | other *** search
- From markd@grizzly.com Sat Oct 9 01:41:05 1993
- Return-Path: <markd@grizzly.com>
- Received: from cats-po-1.UCSC.EDU by cs-mail.bu.edu (5.61+++/Spike-2.1)
- id AA23414; Sat, 9 Oct 93 01:40:54 -0400
- Received: from scruz.UCSC.EDU by cats.ucsc.edu with SMTP
- id AA19004; Fri, 8 Oct 93 22:40:53 -0700
- Received: from osprey by scruz.ucsc.edu id aa06254; 8 Oct 93 22:31 PDT
- To: tasos@cs.bu.edu
- Cc: unix-listproc@stormking.com
- Subject: util/mmdfcatmail.c patch
- Date: Fri, 8 Oct 93 22:17:08 PDT
- From: Mark Diekhans <markd@grizzly.com>
- Message-Id: <9310082217.aa21335@osprey.grizzly.com>
- Status: RO
-
-
- Enclosed is a patch to the util/mmdfcatmail.c program. Due to the behavior of
- extract_address, it would fail if a From: hreader did not contain a comment!
- Someone mailed me about this recently, before I found the problem, but I have
- lost their mail.
-
- Mark
-
-
- *** util/mmdfcatmail.c.org Fri Oct 8 22:09:35 1993
- --- util/mmdfcatmail.c Fri Oct 8 22:09:54 1993
- ***************
- *** 169,179 ****
- argv [0] = CATMAIL;
- execv (CATMAIL, argv);
-
- ! fprintf (stderr, "exec of %s failed: %s", CATMAIL, strerror (errno));
- exit (1);
- }
-
- /*
- * Do actual work of copying stdin catmail process, filling in the missing
- * "From address Date" line.
- */
- --- 169,190 ----
- argv [0] = CATMAIL;
- execv (CATMAIL, argv);
-
- ! fprintf (stderr, "exec of %s failed: %s\n", CATMAIL, strerror (errno));
- exit (1);
- }
-
- /*
- + * Extract address even if it has leading spaces. The standard extract
- + * address only works with leading spaces if there are <> or () in the
- + * address.
- + */
- + ExtractAddress (char *addr)
- + {
- + cleanup_request (addr);
- + extract_address (addr);
- + }
- +
- + /*
- * Do actual work of copying stdin catmail process, filling in the missing
- * "From address Date" line.
- */
- ***************
- *** 203,226 ****
- * Search for the minimum headers we need and save away lines for later
- * output.
- */
- ! while (! ((fromAddress [0] != '\0') && (date [0] != '\0'))) {
- if (fgets (line, MAX_LINE, stdin) == NULL)
- break;
-
- SaveLine (line, &headerList);
-
- if (strncmp (line, "From:", 5) == 0) {
- strcpy (fromAddress, line + 5);
- ! extract_address (fromAddress);
- continue;
- }
- ! if (strncmp (line, "Sender:", 6) == 0) {
- strcpy (fromAddress, line + 6);
- ! extract_address (fromAddress);
- continue;
- }
- if (strncmp (line, "Date:", 5) == 0) {
- strcpy (date, line + 6);
- continue;
- }
- linesRead++;
- --- 214,246 ----
- * Search for the minimum headers we need and save away lines for later
- * output.
- */
- ! while (TRUE) {
- if (fgets (line, MAX_LINE, stdin) == NULL)
- break;
-
- SaveLine (line, &headerList);
-
- + /*
- + * Remove leading spaces, terminate loop if its a blank line.
- + */
- + cleanup_request (line);
- + if (line [0] == '\0')
- + break;
- +
- if (strncmp (line, "From:", 5) == 0) {
- strcpy (fromAddress, line + 5);
- ! ExtractAddress (fromAddress);
- continue;
- }
- ! if ((strncmp (line, "Sender:", 6) == 0) &&
- ! (fromAddress [0] == '\0')) {
- strcpy (fromAddress, line + 6);
- ! ExtractAddress (fromAddress);
- continue;
- }
- if (strncmp (line, "Date:", 5) == 0) {
- strcpy (date, line + 6);
- + cleanup_request (date);
- continue;
- }
- linesRead++;
-
-